<?php

defined('SYSPATH') or die('Access error!');

/**
 * 用户的问答管理类
 * ============================================================================
 * 功能描述： 
 *     用来处理用户的提问
 * ============================================================================
 * $Author: liuxudong $
 */
class Controller_User_Q2a_Question extends Controller_User_Main
{

    private $post;
    private $where_arr = array();

    public function before()
    {
        parent::before();
        $this->post = Model::factory('q2a_post');
        
        $this->where_arr['post_type'] = Q2A_POST_TYPE_QUESTION;
        $this->where_arr['user_id'] = $this->user_detail['id'];
        
         $this->template->assign('current_selected',URL::site('user/q2a/question/all'));
    }

    public function action_all()
    {
        
    }

    public function action_unanswer()
    {
        $this->where_arr['answer_count'] = 0;
    }

    public function action_answered()
    {
         $this->where_arr['answer_count!'] = 0;
    }

    public function post_list()
    {
        $post_list = $this->post->get_post_list($this->where_arr);
        $this->template->assign('post_list', $post_list);
        $this->template->view('user_q2a_question_list');
    }

    public function after()
    {
        $this->post_list();
        parent::after();
    }

}